package com.ki.glasscase.svc.services.impl;

import com.ki.glasscase.svc.dao.ProductDAO;
import com.ki.glasscase.svc.entity.Product;
import com.ki.glasscase.svc.entity.Tag;
import com.ki.glasscase.svc.services.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.logging.Logger;

/**
 * Created by Khacheresyants.l on 2/27/14.
 */
@Service
public class ImplProductService implements ProductService {
    @Autowired
    public ProductDAO productDAO;

    @Override
    public Long create(Product product) {
        return productDAO.create(product);
    }

    @Override
    public Long update(Product product) {
        return productDAO.update(product);
    }

    @Override
    public Product getById(Long id) {
        return productDAO.getById(id);
    }

    @Override
    public Product getByOriginalId(String originalId) {
        return productDAO.getByOriginalId(originalId);
    }

    @Override
    public List<Product> getAll(int limit, int offset) {
        return productDAO.getAll(limit, offset);
    }

    @Override
    public List<Product> searchByParam(String param, int limit, int offset) {
        return productDAO.searchByParam(param, limit, offset);
    }

    @Override
    public List<Product> searchByTag(Tag tag, int limit, int offset) {
        return productDAO.searchByTag(tag, limit, offset);
    }

    @Override
    public Integer getCountByParam(String param) {
        return productDAO.getCountByParam(param);
    }
}
